<?php if (!defined('THINK_PATH')) exit();?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/skin/green/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="/Public/css/common.css" />
<!--[if IE 6]>
<script type="text/javascript" src="/Public/Admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>用户管理</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 
    <span class="c-gray en">&gt;</span> 权限管理
    <span class="c-gray en">&gt;</span> 管理员列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="pd-20">

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <a href="javascript:;" onclick="member_add('添加用户','<?php echo U(admin_info);?>','','')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加用户</a></span>
        <span class="r">共有数据：<strong><<?php echo ($count); ?>></strong> 条</span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg table-sort">
        <thead>
            <tr class="text-c">
                <th>用户名</th>
                <th>所属角色</th>
                <th>描述</th>
                <th>加入时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="text-c">   
                    <td><?php echo ($vo['username']); ?></td>
                    <td><?php echo ($vo['role_name']); ?></td>
                    <td><?php echo ($vo['remark']); ?></td>
                    <td><?php echo (date("Y-m-d H:i:s",$vo['reg_time'])); ?></td>
                    <td class="f-14 user-manage">
                    <a title="编辑" href="javascript:;" onclick="member_edit('账号编辑','<?php echo U(admin_info);?>','<?php echo ($vo[id]); ?>')" class="ml-5" style="text-decoration:none">
                    <span><i class="Hui-iconfont">&#xe6df;</i> 编辑</span>
                    </a>
                    <a title="删除" href="javascript:;" onclick="member_del(this)" data-id="<?php echo ($vo['id']); ?>" class="ml-5" style="text-decoration:none">
                    <span><i class="Hui-iconfont">&#xe6e2;</i> 删除</span>
                    </a>
                    </td>
                </tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>
        </tbody>
    </table>
    <div id="pageNav" class="pageNav">共有<i class="blue"><?php echo ($count); ?></i>条记录，当前显示<i class="blue"><?php echo ($p); ?></i>页，共计<i class="blue"><?php echo ((isset($totalPages) && ($totalPages !== ""))?($totalPages):0); ?></i>页<?php echo ($show); ?></div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui.admin/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 

<!-- <script type="text/javascript" src="/Public/Admin/lib/picker/distpicker.data.js"></script> -->
<!-- <script type="text/javascript" src="/Public/Admin/lib/picker/distpicker.js"></script> -->


<script type="text/javascript" src="/Public/js/common.js"></script>
<script type="text/javascript" src="/Public/js/md5.js"></script>

<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">
/*用户-添加*/
function member_add(title,url,w,h){
    var index = layer.open({
        type: 2,
        title: title,
        content: url
    });

    layer.full(index);
}

/*用户-编辑*/
function member_edit(title,url,id,w,h){
  var index = layer.open({
    type: 2,
    title: title,
    content: url + '?id='+id
  });

  layer.full(index);
}


/*用户-停用*/
function member_del(obj){
    var load;
    var id = $(obj).data('id');
    layer.confirm('确认要删除吗？',function(index){
        $.ajax({
            type: 'post',
            url: '/admin/admin/adminHandle',
            data:{admin_id:id, act: 'del'},
            dataType: 'json',
            beforeSend:function(){
                load = layer.load(1)
            },
            success: function(res){
                if(res.status == 0)
                {
                    layer.msg(res.message,{icon:1,time:2000},function(){
                        location.reload();
                    })
                }
                else
                {
                    layer.msg(res.message,{icon:2,time:2000})
                }
            },
            error:function(data) {
                layer.alert("网络错误，请稍后重试！");
            },
            complete:function(){
                layer.close(load);
            }
        });   
    });
}

</script>
</body>
</html>